package com.genexususa.eo.bing.data.wsSubclasses;

import com.genexususa.eo.bing.CampaignManagementServiceClasses.AgeTarget;
import com.genexususa.eo.bing.CampaignManagementServiceClasses.AgeTargetBid;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;

public class GxAgeTarget extends AgeTarget {
    public GxAgeTarget(Element element) {
        NodeList bidsNode = element.getElementsByTagName("AgeTargetBidCollection");
        if (bidsNode.getLength() > 0) {
            NodeList ageTargetBidNode = ((Element)bidsNode.item(0)).getElementsByTagName("AgeTargetBid");
            AgeTargetBid[] ageTargetBids = new AgeTargetBid[ageTargetBidNode.getLength()];
            for (int temp = 0; temp < ageTargetBidNode.getLength(); temp++) {
                ageTargetBids[temp] = new GxAgeTargetBid((Element)ageTargetBidNode.item(temp));
            }
            this.setBids(ageTargetBids);
        }
    }
}
